package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.Lsh库存内部可见Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public interface Lsh库存内部可见Repository extends JpaRepository<Lsh库存内部可见Model, Integer>, JpaSpecificationExecutor<Lsh库存内部可见Model> {

    @Modifying
    @Query("DELETE FROM Lsh库存内部可见Model u WHERE  u.库存编号 = ?1")
    void delInternalVisibleLevel(Integer 库存编号);

    @Query("SELECT u FROM  Lsh库存内部可见Model u WHERE  u.库存编号 = ?1")
    Lsh库存内部可见Model findBystocknumber(Integer 库存编号);

    @Modifying
    @Query("update Lsh库存内部可见Model a set a.内部可见角色=?1 where a.库存内部可见编号=?2")
    int updateStatusById(String status, Integer id);

}
